﻿using System;
using System.Collections.Generic;
using System.Text;
using Galaxy.ModuleInterface.Events;
using Galaxy.ModuleInterface;

namespace Galaxy.ModuleInspector.Events
{                                    
    public delegate void OnModuleConnectedEventHandler(
        GalaxyModuleInspector ModuleInspector,
        OnModuleConnectedEventArgs Arg);

    public class OnModuleConnectedEventArgs : GalaxyModuleEventArgs
    {
        public IGalaxyModule Module;

        public OnModuleConnectedEventArgs(IGalaxyModule Module)
        {
            this.Module = Module;
        }
    }

}

namespace Galaxy.ModuleInspector
{
    using Galaxy.ModuleInspector.Events;

    partial class GalaxyModuleInspector
    {
        public event OnModuleConnectedEventHandler OnModuleConnected;
        protected virtual void InvokeOnModuleConnected(IGalaxyModule Module)
        {
            if( OnModuleConnected != null )
                OnModuleConnected.Invoke(this, new OnModuleConnectedEventArgs(Module));
        }

        public event OnModuleConnectedEventHandler OnModuleDisconnected;
        protected virtual void InvokeOnModuleDisconnected(IGalaxyModule Module)
        {
            if( OnModuleDisconnected != null )
                OnModuleDisconnected.Invoke(this,
                    new OnModuleConnectedEventArgs(Module));
        }
    }
}
